@import "tailwindcss";

@custom-variant dark (&:where(.dark, .dark *));


@theme inline {
  --primary-bg: #050505;
  --secondary-bg: #121212;
  --tertiary-bg: #171717;
  --border: #343434;
  --color-primary: #fff;
  --color-el-2: #707070;
  --color-el-3: #939393;
  --color-el-4: #e6e6e6;
  --font-sans: var(--inter);
  --font-mono: var(--geist-mono);
  --font-serif: var(--tasa);
  --tag-blue: 211,69%,49%;
  --tag-green: 143,97%,54%;
  --tag-purple: 286,38%,52%;

}

:root {
  --nextra-navbar-height: 60px;
  --nextra-content-width: 1220px;
}

body:is(html[class~="dark"] *){
  background: var(--primary-bg);
}


/* Navbar */
.nextra-navbar-blur {
  display: none;
}

header + div, footer{
  --nextra-content-width: 1220px;
}

header {
  position: static;
  background: var(--primary-bg);
}

header > * {
  background: var(--primary-bg);
}

 header nav > div:nth-child(2){
    display: none;
}

/* mobile nav */
.nextra-mobile-nav{
  padding-block-start: calc(var(--nextra-navbar-height) * 2);
}


.nextra-navbar nav > a {
  &:hover{
    transition: none;
    opacity: 1;
  }
}

.nextra-navbar input[type="search"] {
  width: 180px;
  height: 34px;
  font-size: 14px;
  border-radius: 0.375rem;
  background: #121212;
  border: 0.5px solid #343434;

  &::placeholder {
    color: var(--color-el-3);
  }

  &:focus{
    box-shadow: none;
    outline: 1px solid hsl(var(--tag-green));
  }
}

.nextra-navbar kbd {
  border-radius: 4px;
  border: unset;
  color: var(--color-el-3);
}

.nextra-navbar:is(html[class~="dark"] *) kbd {
  background: #000000bf;
}

.nextra-navbar:is(html[class~="light"] *) kbd {
  background: #f0f0f0;
}

.nextra-navbar nav {
  position: relative;
  --nextra-content-width: 1220px;

  @media screen and (min-width: 768px) {
    padding-inline: 0;
  }
}

/* Hack for menu */
.nextra-navbar nav > div:nth-child(2) {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  gap: 1rem;
  margin-top: 1px;
}

/* Navbar menu items */
.nextra-navbar nav > div:nth-child(2) > * {
  padding: 0.62rem;
  font-weight: 500;
}

/* Navbar menu items svg */
.nextra-navbar nav > div:nth-child(2) > * svg {
  display: none;
}

@media (max-width: 1024px) {
  .nextra-navbar nav > div:nth-child(2) {
    position: relative;
    left: 0;
    transform: translateX(0);
  }
}

@media (min-width: 1024px) {
  .nextra-navbar nav > div:nth-child(3) {
  }
}

/*****Main Content******/

aside {
  --button-gap: 0.38rem;
  --icon-position: 11.5px;
}

article{
  --x-color-gray-400: var(--color-el-3);
}

aside + div {
  --nextra-content-width: 1220px;
}

article span.m-tag {
  display: none;
}

article a {
  text-underline-offset: 1px;
}

article strong > a {
  font-weight: 500;
}

.nextra-breadcrumb {
  background: var(--secondary-bg);
  padding: 0.47rem 0.69rem;
  width: fit-content;
  border-radius: 0.375rem;
}

pre code {
  --x-text-sm: 13px;
  --x-color-gray-500: var(--color-el-2);
}

pre,
div:has(+ pre) {
  border: 0.5px solid var(--border);
  border-radius: 0.5rem;
  background: var(--tertiary-bg);
  box-shadow: none;
}

div:has(+ pre ) {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

div + pre {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

button[title="Copy code"] {
  border: none;
}

.nextra-code span {
  color: var(--color-primary);
}

main h3:has(+ div.nextra-code) {
  display: none;
}

/*****Sidebar******/
aside{
  border-right: 0.5px solid var(--border);
}
aside > * {
  --x-color-primary-600: #fff;
  --x-color-primary-400: oklab(
    18.2% -0.000000000000000147 0.0000000000000000204
  );
}

aside>div:first-child button{
  font-weight: 500;
  color: var(--color-primary);
}

/*Size of chevron*/
aside > div:nth-child(1) button svg {
  width: 1rem;
  height: 1rem;
}

aside > div:nth-child(1) ul:before {
  inset-inline-start: calc(var(--x-spacing) * 0.92);
}

/*Active link indicator*/
aside > div:nth-child(1) ul li {
  position: relative;
}

aside > div:nth-child(1) ul li a {
  padding-block: 0.25rem;

  &:hover {
    background: transparent;
  }
}

aside > div:nth-child(1) ul li.active:has(> a) {
  &::before {
    content: "";
    position: absolute;
    left: -8px;
    top: 0px;
    bottom: 0;
    height: calc(100%);
    background: var(--x-color-primary-600);
    width: 1.5px;
    transition: opacity 0.1s ease-in-out;
  }
}

aside > div:nth-child(1) ul li.active:has(a[href="/docs"]),
aside > div:nth-child(1) ul li.active:has(a[href="/examples"]),
aside > div:nth-child(1) ul li.active:has(a[href="/guides"]),
aside > div:nth-child(1) ul li.active:has(a[href="/reference"]) {
  &::before {
    content: "";
    background: transparent;
  }
}

aside a[href="/docs"],
aside button[data-href="/docs/reference"],
aside a[href="/examples"],
aside a[href="/guides"],
aside a[href="/reference"] {
  position: relative;
  padding-inline-start: calc((var(--button-gap) * 3) + var(--icon-position));
}

aside a[href="/docs"]::before,
aside button[data-href="/docs/reference"]::before,
aside a[href="/examples"]::before,
aside a[href="/guides"]::before,
aside a[href="/reference"]::before {
  content: "";
  position: absolute;
  left: var(--icon-position);
  top: 50%;
  transform: translateY(-50%);
  width: 0.7rem;
  height: 0.8rem;
  background-size: contain;
  background-repeat: no-repeat;
}

aside a[href="/docs"]::before,
aside a[href="/examples"]::before,
aside a[href="/guides"]::before
{
  background-image: url("icons/introduction.svg");
}

aside button[data-href="/docs/reference"]::before,aside a[href="/reference"]::before  {
  background-image: url("icons/reference.svg");
}

button[data-href="/docs/reference"] svg {
  display: none;
}

button[title="Collapse sidebar"] {
  display: none;
}

aside > div:nth-child(2) {
  display: flex;
  --x-color-nextra-bg: var(--primary-bg);
}

button[title="Change theme"] {
  display: none;
}

aside > div:nth-child(1) button {
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: var(--button-gap);
}

/*** Table of Contents ***/

.nextra-toc > * {
    --x-color-gray-400: #939393;
}

.nextra-toc div > p {
  position: relative;
  color: var(--color-el-3);
  font-weight: 500;
  padding-inline-start: 2.24rem;

  &::before {
   content: "";
   position: absolute;
   left: 12px;
   bottom: 1;
   width: 1rem;
   height: 1rem;
   background-size: contain;
   background-repeat: no-repeat;
   background-image: url("icons/on-this-page.svg");
  }
}

.nextra-toc ul a{
  --x-color-gray-400: var(--color-el-3);
  --x-color-primary-600: var(--color-primary);
  --x-color-gray-600: var(--color-el-3);
  font-weight: 500;
}


.showcase-item > *{
  &:hover{
    text-decoration: none;
  }
}

/** one off utility **/

a:focus-visible{
  border-radius:4px;
}